home *** CD-ROM | disk | FTP | other *** search
- Subject: v12i013: Cake, a make replacement, Part07/09
- Newsgroups: comp.sources.unix
- Sender: sources
- Approved: rs@uunet.UU.NET
-
- Submitted-by: Zoltan Somogyi <zs@munnari.oz>
- Posting-number: Volume 12, Issue 13
- Archive-name: cake/part07
-
- #! /bin/sh
- # This is a shell archive, meaning:
- # 1. Remove everything above the #! /bin/sh line.
- # 2. Save the resulting text in a file.
- # 3. Execute the file with /bin/sh (not csh) to create:
- # README
- # cake.1l
- # ccincl.1l
- # ccs.1l
- # cs.1l
- # gred.1l
- # gres.1l
- # gsrc.1l
- # irrel.1l
- # later.1l
- # need.1l
- # needed.1l
- # ol.1l
- # soincl.1l
- # ssize.1l
- # sub.1l
- # subcmd.1l
- # usrc.1l
- # yyrepl.1l
- # This archive created: Wed Oct 14 20:26:03 1987
- export PATH; PATH=/bin:/usr/bin:$PATH
- echo mkdir Man
- mkdir Man
- echo cd Man
- cd Man
- echo shar: "extracting 'README'" '(684 characters)'
- if test -f 'README'
- then
- echo shar: "will not over-write existing file 'README'"
- else
- sed 's/^X//' << \SHAR_EOF > 'README'
- XThis directory contains manuals for cake and its associated commands.
- X
- XThe manuals are named *.1l. They are written for the -man macros
- X(of course), and are patterned after Pyramid manual pages - I started
- Xwriting them while using a Pyramid 90x. You may want to change the
- Xpathnames in cake.1l to match the ones you put in ../conf.h.
- X
- XThe file paper.bib contains a partially preprocessed version of a paper
- XI wrote on cake; the citation is
- X
- X%A Zoltan Somogyi
- X%T Cake: a fifth generation version of make
- X%J Australian Unix system User Group Newsletter
- X%K auugn
- X%V 7
- X%N 6
- X%D April 1987
- X%P 22-31
- X
- XThe file has been put through bib; you should put it through eqn, tbl
- Xand the -me macros.
- SHAR_EOF
- if test 684 -ne "`wc -c < 'README'`"
- then
- echo shar: "error transmitting 'README'" '(should have been 684 characters)'
- fi
- fi
- echo shar: "extracting 'cake.1l'" '(24383 characters)'
- if test -f 'cake.1l'
- then
- echo shar: "will not over-write existing file 'cake.1l'"
- else
- sed 's/^X//' << \SHAR_EOF > 'cake.1l'
- X.ds c \fIcake\fP
- X.ds C \fICake\fP
- X.ds cf \fIcakefile\fP
- X.ds Cf \fICakefile\fP
- X.if n .ds lq \&"\"
- X.if n .ds rq \&"\"
- X.if t .ds lq ``
- X.if t .ds rq ''
- X.TH CAKE 1-ucb
- X.SH NAME
- Xcake \- maintain groups of related files
- X.SH ORIGIN
- XUniversity of Melbourne
- X.SH SYNOPSIS
- X.B cake
- X[ options ] ... file ...
- X.SH DESCRIPTION
- X.PP
- X\*C is a program to maintain groups of related files.
- XA \*(cf needs to describe for each file
- Xthe set of other files it can be made from,
- Xand the action which will update it from those files.
- XThen, given this \*(cf and the names of some files,
- X\*c traces through the network of dependencies
- Xand executes just those actions necessary to update the files.
- XThis is much faster than issuing the same commands manually
- Xand it virtually eliminates the risks
- Xof working with out-of-date files.
- X.PP
- X\*C's province overlaps that of make(1).
- XHowever, \*c's design philosophy emphasizes simplicity and generality
- Xto a much greater extent than make's.
- XThe principal differences are:
- X.IP (a)
- X\*C dependencies may be dynamic,
- Xand their applicability may be conditional upon a test.
- X.IP (b)
- X\*C rules have the same syntax and semantics as ordinary dependencies,
- Xand may have any number of targets.
- X.IP (c)
- XThere are no restrictions on the forms of
- Xeither the targets or the sources.
- XThis enables \*c to handle files in more than one directory
- Xand to interface with SCCS, RCS and archivers,
- Xamong others, without any special arrangements.
- X.IP (d)
- X\*C has a more general search algorithm than make.
- XWhen seeking a target it considers all rules which could update it
- Xeven if the corresponding intermediate files do not exist;
- Xit recreates them if (and only if) it is necessary to do so.
- X.IP (e)
- X\*(Cfs are passed through the C preprocessor.
- XThey may therefore #include other \*(cfs (including standard ones)
- Xand use #if and #ifdef to customize themselves.
- X.IP (f)
- X\*C allows the user to choose his own shell,
- Xand to include shell scripts in actions.
- X.IP (g)
- X\*C can check to see if a newly 'updated' file
- Xhas actually been changed via a bit-by-bit comparison,
- Xwhich works even if the modify date has been touched.
- XIf there is no change, \*c avoids recomputing the file's dependents.
- X.IP (i)
- X\*C has a lot more options
- X(whether one considers these an improvement
- Xof course depends on whether one needs them).
- X.PP
- X\*C is not oriented toward any particular type of files,
- Xas make is towards program files (source and object).
- XFor example, standard \*(cfs exist to handle
- Xdocuments and VLSI designs, as well as programs.
- X.SH SYNTAX
- X.sp
- XBefore being seen by \*c,
- X\*(cfs are piped through the C preprocessor.
- XThe standard arguments to the preprocessor set up the search path
- Xto visit the user's library directory (~/lib/cake)
- Xand the directory /usr/lib/cake, which contains
- Xstandard sets of entries for program development, text processing, etc.
- XIn addition, \*c gives its command line arguments to the preprocessor
- Xas the value of the macro CAKEFLAGS.
- X.PP
- X\*C accepts standard C comments as well as
- Xcomments starting with a '$' and extending to the end of the line
- X(the first are stripped by the preprocessor, the second by \*c itself).
- XThe single-line comments are particularly useful for commenting out
- Xpreprocessor directives by changing '#' into '$' or '$#'.
- X.PP
- XA fair number of characters have special meaning for \*c.
- XAny character can be prevented from being recognised as special
- Xby preceding it with a backslash.
- XThis can also be used to put arbitrary characters (including backslashes
- Xbut excluding newline and formfeed) into patterns (see below).
- X.PP
- XA \*(cf after preprocessing should be
- Xa sequence of entries separated by blank lines,
- Xwith possibly one or more lines indicating options.
- XOption lines must be aligned on the margin
- Xand begin with the word \*(lqset\*(rq;
- Xthe rest of the line is processed as a set of \*c options.
- XAn entry consists of dependency rules aligned on the left margin
- X(with targets to the left and sources to the right of the colon)
- Xand a possibly empty list of indented action lines (as in make).
- XIf more than one dependency is given
- Xthe actions apply to all of them.
- X.PP
- X\*C treats unescaped percent signs and a possible following digit
- X(% and %0 to %9) as 11 \*(lqvariables\*(rq
- Xfor which any string may be consistently substituted
- Xthroughout an entry.
- XSo an entry which contains variables
- Xis a template for an infinite number of entries without variables.
- XThis is the mechanism \*c uses
- Xinstead of make's entries with .x.y targets.
- X.PP
- XThe following yacc grammar describes the syntax of
- Xdependency rules (rule) and of actions (act).
- XThe suffixes _l and _el denote
- Xnonempty and possibly empty lists respectively.
- XKeywords are quoted;
- Xother terminal symbols are in uppercase.
- X.sp
- X.nf
- Xrule : pat_l \*(lq:\*(rq pat_el cond
- X | pat_l \*(lq::\*(rq pat_el cond
- Xcond : \*(lqif\*(rq test
- X | /* empty */
- Xtest : basepat \*(lqin\*(rq pat_l
- X | basepat \*(lqmatch\*(rq basepat
- X | basepat \*(lqmatch\*(rq basepat basepat
- X | \*(lqexist\*(rq basepat
- X | \*(lqcando\*(rq basepat
- X | \*(lqok\*(rq basepat
- X | TESTCMD
- X | test \*(lqand\*(rq test
- X | test \*(lqor\*(rq test
- X | \*(lqnot\*(rq test
- X | \*(lq(\*(rq test \*(lq)\*(rq
- Xact : aflag_el ACT
- X | aflag_el BEGIN_ACT ACT_el END_ACT
- Xbasepat : PAT
- X | PATCMD
- Xpat : basepat pflag_el
- X | \*(lq(\*(rq pat_l \*(lq)\*(rq flag_el
- Xaflag : \*(lq@\*(rq
- X | \*(lq-\*(rq
- X | \*(lq+\*(rq
- X | \*(lq!\*(rq
- Xpflag : \*(lq@\*(rq
- X | \*(lq&\*(rq
- X | \*(lq!\*(rq
- X | \*(lq^\*(rq
- X | \*(lq*\*(rq
- X.fi
- X.PP
- XA dependency rule consists of a list of \fItarget\fP patterns
- Xfollowed (after a colon) by a list of \fIsource\fP patterns.
- XIt states that the files corresponding to the target patterns
- Xdepend on the files of the source patterns.
- XIf any are out-of-date, \*c will try to update them;
- Xsee the section on semantics.
- XThe difference between single and double colons
- Xis explained there also (it is \fInot\fP the same as in make)).
- X.PP
- XThere are two kinds of patterns.
- XA name pattern (PAT) is a sequence of letters,
- Xdigits and special symbols from the set _/%,.+-
- Xalthough other characters can also be included
- Xif escaped with a backslash.
- XAn alternate form, which obviates the need for backslashes
- Xis a sequence of characters between double quotes,
- Xwhich themselves can be included if escaped with a backslash.
- X.PP
- XThe other kind of pattern (a pattern given by command: PATCMD)
- Xis a string enclosed in matching double square brackets,
- Xe.g. [[echo *.c]].
- XThe string may contain non-matching double square brackets
- Xif at least one is escaped with a backslash.
- XStrings between matching brackets are executed as commands
- Xand replaced by the output of the command, innermost-first.
- XThe expansion in this fashion of a PATCMD is then
- Xinterpreted as a pattern, or as a possibly empty list of patterns
- Xif that is more appropriate.
- XE.g. the PATCMD [[sub X.c X.o [[echo *.c]]]] when executed
- Xin a directory which contains a.c b.c and c.c will expand to
- Xthe list a.o, b.o and c.o.
- XNote that the generated patterns must be name patterns,
- Xnot command patterns, i.e. if a command's output contains
- Xdouble brackets they will not be ignored.
- X.PP
- XOf the five flags that can appear after patterns and pattern lists,
- Xfour apply to target patterns,
- Xand one ('*') applies to source patterns.
- X.IP '@'
- XA '@' character tells \*c that the target is not volatile;
- Xwhenever \*c executes the associated command
- Xit checks if it changes the nonvolatile file.
- XIf not, its dependents are not considered out-of-date wrt this file.
- X.IP '&'
- XA '&' postfix means that the pattern is not really a file;
- Xthis prevents \*c from worrying
- Xif there are no actions to generate the pseudofile
- Xor if the actions do not create a file
- Xwith the pattern's name.
- X.IP '!'
- XA '!' tells \*c to consider the target precious in the sense of make.
- XDirectories are automatically precious.
- X.IP '^'
- XA file marked with '^' is deleted before \*c exits
- Xunless it is one of the main targets or if it cannot be regenerated.
- X.IP '*'
- XA star after a source name pattern
- Xtells \*c to update the flagged file
- Xbefore expanding source command patterns and before executing the test.
- XStars cannot appear after target patterns
- Xor after source command patterns.
- X.PP
- XThe definitions of the five primitive tests:
- X.br
- X.TP 14
- X{{cmd}}
- XExecute cmd and interpret its exit status:
- Xzero is true, everything else is false.
- XThe cmd may contain matched sets of double square brackets,
- Xjust as in PATCMD.
- X.TP 14
- X\*(lqexist\*(rq file
- XTrue if file exists.
- X.TP 14
- X\*(lqcando\*(rq file
- XTrue if file can be made according to this \*(cf.
- X.TP 14
- X\*(lqok\*(rq file
- XTrue if file is up-to-date according to this \*(cf.
- X.TP 14
- Xfile \*(lqmatch\*(rq pattern
- XTrue if file is matches pattern,
- Xwith X as the variable character.
- X.TP 14
- Xfile \*(lqmatch\*(rq argument pattern
- XTrue if file is matches pattern,
- Xwith argument specifying the variable character
- Xas if it were an option to sub(1).
- XE.g. an omitted argument is equivalent to \-vX as the argument.
- X.TP 14
- Xpat \*(lqin\*(rq pat1 .. patn
- XTrue if pat occurs among the list pat1 .. patn.
- X.PP
- XThe precedence of \*(lqand\*(rq, \*(lqor\*(rq and \*(lqnot\*(rq,
- Xincreases in that order;
- Xparentheses can be used to override precedence.
- X.PP
- XSyntactically, actions (ACT) are lines beginning with spaces or tabs.
- XBEGIN_ACT and END_ACT stand for actions
- Xbeginning with '{' and '}' respectively;
- Xas a stylistic concession,
- Xthey may begin on the left margin, although they don't have to.
- XAll actions may contain newlines escaped by a backslash.
- X.PP
- XActions may be prefixed with flags.
- XTwo ('@' and '-') turn on options \-s and \-i respectively
- Xfor a single action.
- XThe third ('+') tells cake to execute the action
- Xeven if \-n says it shouldn't
- X(this is useful e.g. for recursive invocations of \*c with \-n).
- XThe fourth ('!') causes cake to give the action to the shell
- Xeven if it doesn't have to.
- X.SH SEMANTICS
- X.sp
- X\*C's semantics is based on that of make.
- XThe chief differences were listed
- Xat the beginning of this manual entry;
- Xa complete description with (hopefully illuminating) examples
- Xshould be in the \*c users' guide (if it ever gets finished).
- X.PP
- XBriefly, \*c goes about updating a file in two main phases
- Xafter an initial phase.
- XThis initial phase does two things.
- XOne, it expands any command patterns on the left side of dependencies.
- XAs at this stage there is no way to find values for them,
- Xvariables should not occur in these patterns.
- XTwo, this phase selects the main target to be made
- Xif it was not given on the command line.
- XThis target is the target of the first specific (variable-free)
- Xdependency in the main \*(cf,
- Xor in any include files if there is no such dependency
- Xin the main \*(cf itself.
- XFor this purpose, entries with double colons
- Xare treated as if they were in the main \*(cf.
- X.PP
- XIn the first phase, \*c plans ahead.
- XIt matches the name(s) of the main target(s)
- Xagainst the patterns on the left hand side of dependencies.
- XA match must give values to every variable appearing in the entry;
- Xthese variables are replaced by their values in the rest of the entry.
- X\*C next updates any starred name patterns in the matched entry,
- Xexpands any source command patterns and evaluates the test (if any).
- X.PP
- X\*C classifies the surviving entries into two kinds:
- Xthose with actions and those without.
- XThe ones without actions represent unconditional dependencies,
- Xand their sources are now planned for.
- XIf any cannot be made, then the original file cannot be made either,
- Xalthough \*c will update as many components as it can.
- XNext \*c tries to plan for the sources of the entries with actions,
- Xand selects an entry for which all sources can be made.
- X(it is best to ensure either that there is only one such entry
- Xor that the effects of the actions of all these entries are the same).
- X.PP
- XAt the end of the planning phase
- X\*c has a directed acyclic graph
- Xrepresenting dependencies between files.
- XThe information attached to the nodes of this graph says
- Xwhether the file exists or not, what is its modify time if it does
- Xand what is its conceptual modify time.
- XThe conceptual modify time of a file with no ancestors
- Xis its real modify time;
- Xthe conceptual modify time of a file with ancestors
- Xis the latest conceptual modify time of any of its ancestors.
- X(Pseudofiles and files with no ancestors but with actions
- Xare treated specially, but in the same general spirit.)
- XThe execute phase just traverses the graph in a postorder-like fashion,
- Xand invokes the actions of those nodes whose files do not exist
- Xor whose modify times are earlier than their conceptual modify times.
- X.PP
- XActions and commands returning nonzero status
- Xprevent any further processing of the node involved
- Xand lead to the deletion of the targets,
- Xexcept in the obvious of case of tests
- X(where the status code is used to return a boolean value
- Xand not to signal an error).
- X.PP
- XThe above is only a sketch of what actually happens.
- XFor example, it does not describe what happens
- Xwhen an entry has more than one target.
- XAnd of course flags on patterns and actions and command-line arguments
- Xall modify \*c's behaviour.
- XA detailed explanation with examples of all this
- Xcan be found in the \*c users' guide.
- X.SH ACTIONS
- X.sp
- X\*C has three mechanisms for the execution of actions.
- XWhich one \*c chooses depends on the form of the action
- Xbut can be overridden by the user.
- XThe first two were present in make;
- Xthe third is unique to \*c and has a slightly different syntax.
- X.IP (a)
- X\*C may itself parse an action into words and call exec(2).
- XThis is the most efficient way of executing actions,
- Xand is therefore the one that \*c applies whereever possible.
- XHowever, it works only if the action does not contain metacharacters;
- X\*c uses (b) if it does.
- X.IP (b)
- XThe action can be given to the shell.
- X\*C does this if the action contains shell metacharacters
- Xor if it is instructed to by the user (see the action flag '!' above).
- X.IP (c)
- XThe action may be a shell script.
- XShell scripts consist of a sequence of actions,
- Xthe first of which begins with a '{' and
- Xthe last of which begins with a '}'.
- XThe text of an action may follow either or both of '{' and '}',
- Xbut it is neater to have '{' and '}' on lines of their own.
- XAny flags before the second and later lines
- Xof a shellscript are ignored.
- X.PP
- X\*C will expand any bracketed commands in actions
- Xin exactly the same way as if they were command patterns.
- XEach command is executed only once
- Xand its output reused if necessary.
- XThis should not cause any problems
- Xunless the cakefile wants to have the same command is executed
- Xin two different environments;
- Xin this case you can rely on the C-shell backquote mechanism,
- Xbut beware: backquotes and double brackets don't mix.
- X.PP
- XInterrupt and quit signals cause
- Xthe targets of the current actions to be deleted;
- Xthe exceptions are pseudofiles, directories
- Xand targets that have a '!' flag.
- X.SH OPTIONS
- X.sp
- X\*C has most of make's options, but it has new options too.
- XSome of the options have effects that can also be achieved
- Xwith action prefixes, as described below.
- XOptions can be given to \*c (in order of increasing priority)
- Xin the environment variable CAKE,
- Xon the command line
- Xor in the \*(cf itself.
- XOnly the command line options are included in the macro CAKEFLAGS.
- XSome options are not effective when given from inside the \*(cf;
- Xthese are \-f, \-g, \-D, \-I and \-U.
- X.IP \-a
- XAbort the whole run if \*c sees an action return with a nonzero status
- X(\*c can turn a blind eye on a nonzero status if so instructed
- X(see \-i below)).
- XNote that in make the effect of \-a is the default.
- X.IP \-b
- XPrint actions \fIbefore\fP any bracketed commands in them are expanded.
- XThe default is to print them afterwards.
- X.IP \-c
- XUse the last status change time of files
- Xinstead of the last modify time (see stat(2)).
- X.IP \-d
- XDelete all regenerable intermediate files
- Xafter all other tasks have been completed
- X(files which can be updated but which are older than their ancestors
- Xare not considered regenerable).
- XFiles postfixed with '^' are considered candidates for deletion
- Xeven if this flag is not specified.
- X.IP "\-f file"
- XUse the given file to describe dependencies.
- XIf this option is missing,
- X\*(lqcakefile\*(rq, \*(lqCakefile\*(rq,
- X\*(lqrecipe\*(rq and \*(lqRecipe\*(rq are tried, in that order.
- XNote that unlike make, \*c accepts only one \-f option;
- Xif more are supplied, only the last one has effect.
- XWith #include's being expanded by the preprocessor,
- Xmultiple \-f's are not needed.
- X.IP \-g
- XGo to (i.e. cd to) the directory containing the \*(cf
- Xbefore doing anything else.
- XAfter this, all commands and actions issued by \*c
- Xwill behave as if \*c had started in that directory.
- X.IP \-i
- XIgnore the status returned by actions.
- XThis option is turned on for an action
- Xby prefixing it with a '-'.
- XNote that this overrides options \-R and \-a.
- X.IP \-k
- XKeep going in the event of an error,
- Xfollowing branches that are not related to files which cannot be made.
- XSince this is the default in \*c,
- Xit is included purely for compatibility with make.
- XIts only effect is to negate an earlier \-a.
- X.IP \-n
- XTrace and print, but do not execute
- Xthe actions needed to update the targets,
- Xincluding those that are normally executed but not printed.
- XThe prefixes will be printed with the actions.
- XIf the prefixes include '+', the action will still be executed.
- XIn this mode \*c assumes that
- Xthe actions would not change any nonvolatile files.
- XNote that only one of \-n, \-q and \-t may be given,
- Xand that \-n overrides \-s.
- X.IP \-q
- XReport if the main targets are up-to-date:
- Xreturn exit status 0 if they are and 1 otherwise.
- XIn this mode, the only actions executed
- Xare those needed to discover dependency information.
- XNote that only one of \-n, \-q and \-t may be given.
- X.IP \-r
- XAfter each action reset the modify times of target files
- Xto the modify time of the last updated ancestor.
- XThis makes the physical update time
- Xcorrespond more closely to the logical update time.
- X.IP \-s
- XDo not print actions.
- XEven without \-s, \*c does not print actions with a '@' prefix.
- XBoth \-s and '@' are overridden by \-n.
- X.IP \-t
- XTouch, i.e. change only the modified date of targets,
- Xwithout executing any actions.
- XIf the -r flag is set, the modified date will be reset
- Xto the that of the last modified ancestor.
- XIf not, it will reset to the current time.
- XNote that only one of \-n, \-q and \-t may be given.
- X.IP \-v
- XPrint error messages that are even more verbose than usual.
- X.IP \-w
- XThe output of the C preprocessor frequently contains
- Xnon-significant spaces and tabs resulting from macro expansion.
- X\*C normally squeezes these out from actions before printing them.
- XThe \-w (for wide) options prevents \*c from doing this.
- X.IP \-x
- XWhen specified, \-x prevents cake
- Xfrom printing its own error message when an action fails.
- X.IP \-z
- XDo not expect bracketed commands to return zero exit status.
- XUnfortunately a fair number of programs
- Xdo not bother to return the correct exit status;
- Xif you are using one of these then specify \-z.
- X.IP "\-Ddefn, \-Udefn, \-Idir"
- XThese arguments are given to the preprocessor.
- XAny directories named here will be searched before the standard ones.
- X.IP \-G
- XEnable members of a group which has write permission on a directory
- Xto use \*c to update files in that directory,
- Xeven if they don't have write permission on the files themselves.
- X\*C does this by removing all targets of a rule
- Xbefore invoking its actions, \fIeven if they are said to be precious\fP.
- XThe one thing which \fIdoes\fP stop \-G is \-n.
- XIn rare cases this may cause problems with actions prefixed by '+';
- Xthe solution is to remove the offending files by hand.
- X.IP \-L
- XCheck rules for simple loops.
- XIf a target depends directly upon itself, and this option is set,
- X\*c will ignore the rule in question for that target.
- XThis is useful for rules of the form %: DIR_PREFIX/**/%,
- Xwhere DIR_PREFIX turns out to be empty.
- X.IP \-N num
- X\*C allows \fInum\fP outstanding (non-waited for)
- Xprocesses at any one time.
- XIf \fInum\fP is zero,
- Xall commands are executed synchronously.
- XIf it is one or more,
- Xprocesses (up to the limit) are spawned in background
- Xand are waited for only at the point where their results are used.
- XThe default value of N depends on the system:
- Xlarger machines should usually set it higher than smaller ones.
- X(This option is not yet implemented.)
- X.IP \-R
- XDo not remove the targets of any actions
- Xwhich return nonzero status (but see \-i above).
- XThe default is to remove them to keep consistency.
- X.IP "\-S1 shell"
- XUse the given shell to execute commands and actions.
- XNote that the argument of \-S1 needs to be of the form
- X\*(lqcommand\*(rq or \*(lqcommand \-option\*(rq.
- XCommands and simple actions to be executed
- Xare given to the shell as one argument after the option if any.
- XThe C and Bourne shells need -c for option.
- XThe default is \*(lq/bin/csh -fc\*(rq;
- Xto use the Bourne shell specify -S1 \*(lq/bin/sh -c\*(rq.
- X.IP "\-S2 shell"
- XUse the given shell to execute shell scripts.
- XShell needs to be of the same form as the argument of \-S1.
- XScripts are written to a file and
- Xthe filename is passed to the shell after the option if any.
- XOne can use different shells for actions and scripts.
- XThe mnemonic of value of \-S1 and \-S2 is that
- Xthe first only applies to single-line actions,
- Xwhile scripts are always at least two lines long.
- XThe default is \*(lq/bin/csh -f\*(rq;
- Xto use the Bourne shell specify -S2 \*(lq/bin/sh\*(rq.
- X.IP "\-T string"
- XThe characters occurring in the string
- Xare considered metacharacters of the single action (\-S1) shell.
- XIf an action contains any of these it will be given to the shell;
- Xotherwise it will be parsed and executed by cake directly.
- XThe default string (for csh) is *?!&|;<>()[]{}'`"%$~#.
- X.IP \-X
- XNormally \*c will \*(lqremove\*rq user files by moving them to /tmp.
- XIf the \-X option is set, it will remove them permamently.
- X.IP \-Z
- XDo nothing except print the output of the C preprocessor.
- XThis option overrides all others.
- X.SH FILES
- X.sp
- Xcakefile, Cakefile, recipe, Recipe
- X.br
- X/usr/lib/cake
- X.br
- X~/lib/cake
- X.br
- X/tmp/Cake*
- X.SH DIAGNOSTICS
- X.sp
- X\*C's diagnostics fall into three classes.
- XThe most important class is the messages given
- Xwhen \*c finds an error in the \*(cf or during the execution
- Xof an action; these are generally similar to make's,
- Xthough \*c prefixes its messages by its name.
- XThe second class, whose messages begin with "cake system error",
- Xreport problems with \*c's system calls; these should be pretty rare.
- XThe third class, whose messages begin with "cake internal error",
- Xreport overflows of various arrays, which can be fixed by recompilation,
- Xand failed internal consistency checks, which cannot.
- X.PP
- X\*C itself will return nonzero status (actually 1)
- Xif any of the main targets were not updated properly.
- X.PP
- XThe \-Z option can be useful in tracking down syntax errors
- X(that's what it is there for).
- X\*C also has five \*(lqhidden\*(rq options, \-C, \-E, \-P, \-W and \-Y,
- Xwhich print out different kinds of debugging information
- Xduring execution;
- Xthese are not very likely to be helpful to anyone but the author,
- Xbut you never know.
- X.SH "SEE ALSO"
- X.sp
- Xmake(1), ccincl(1), later(1), need(1), soincl(1), sub(1), yyrepl(1).
- X.sp
- XS. I. Feldman:
- X.I
- XMake \- A Program for Maintaining Computer Programs,
- XSoftware - Practice and Experience, April 1979, pp. 255-265.
- X.sp
- XG. S. Fowler:
- X.I
- XA Fourth Generation Make,
- XProceedings of the 1985 Summer Usenix Conference, pp 159-174.
- X.sp
- XZ. Somogyi:
- X.I
- XCake: a fifth generation version of make,
- XAustralian Unix system User Group Newsletter
- X7:6, April 1987, pp. 22-31.
- X.sp
- XThe standard \*(cfs in /usr/lib/cake.
- X.SH BUGS
- X.sp
- XThe C preprocessor sometimes replaces its control lines
- Xwith blank lines instead of removing them.
- XThese blank lines then foul up \*c's picture
- Xof the boundaries of entries.
- XFor this reason, it is safest to use #ifdef's etc
- Xonly on complete entries;
- Xin this case their replacement by blank lines has no effect.
- X.sp
- X\*C's own action/command parsing routine may sometimes make mistakes.
- XIf you suspect that this is the case,
- Xprefix the action by '!',
- Xput a metacharacter into the action/command (" is the easiest),
- Xor enlarge the set of metacharacters with -T
- Xto include a character of the action/command (e.g. a-z).
- X.sp
- XThe set of pattern flags and the set of action flags overlap;
- Xthis is a result of the cramped ASCII character set.
- X.sp
- XThe syntax of options with arguments is confusing.
- XThe ones passed on to the preprocessor have no space
- Xbefore the option's argument; the others do.
- X.sp
- XThe -N option is not yet implemented.
- X.\" @(#)cake.l 9/2/85
- SHAR_EOF
- if test 24383 -ne "`wc -c < 'cake.1l'`"
- then
- echo shar: "error transmitting 'cake.1l'" '(should have been 24383 characters)'
- fi
- fi
- echo shar: "extracting 'ccincl.1l'" '(1583 characters)'
- if test -f 'ccincl.1l'
- then
- echo shar: "will not over-write existing file 'ccincl.1l'"
- else
- sed 's/^X//' << \SHAR_EOF > 'ccincl.1l'
- X.ds c \fIccincl\fP
- X.ds C \fIccincl\fP
- X.TH CCINCL 1-ucb
- X.SH NAME
- Xccincl \- find #include files
- X.SH ORIGIN
- XUniversity of Melbourne
- X.SH SYNOPSIS
- X.B ccincl
- X[ options ] ... file ...
- X.SH DESCRIPTION
- X.sp 1
- X\*C is a tool to find #included files,
- Xand is intended to be used in conjunction with cake(1).
- XIt goes through the given files and
- Xprints out the names of all #included files.
- X.SH OPTIONS
- X.sp 1
- X.IP \-f
- XPrint the current filename and a colon before every include file found.
- X.IP \-r
- XRecursively search every include file found.
- X.IP "\-ifile"
- XIgnore file - don't report it and do not recurse on it.
- X.IP "\-sfile"
- XStop recursion at file but do report it.
- X.IP \-Cdir
- XConsider the current directory to be dir instead of ".".
- X.IP \-Idir
- XSearch for include files in the given directory.
- XLike cpp, \*c searches first the current directory,
- Xthen directories given in \-I arguments,
- Xand then /usr/include.
- XAlso like cpp, the current directory is not searched
- Xfor inclusions using the <file> syntax.
- X.PP
- X\*C detects that two or more different filenames refer to the same file
- Xby checking their inode numbers.
- XIt always uses only one name for a file, the first it encounters.
- X.PP
- X\*C
- X.SH "SEE ALSO"
- Xcake(1)
- X.SH BUGS
- X.sp 1
- X\*C doesn't handle multiple directory jumps very well;
- Xin particular when processing include files in a different directory
- Xit still interprets file names with respect to the current directory,
- Xnot with respect to the new directory, as cpp does.
- X.PP
- X\*C is in trouble if it finds two files in different filesystems
- Xthat have the same inode number.
- X.\" @(#)ccincl.l 9/2/85
- SHAR_EOF
- if test 1583 -ne "`wc -c < 'ccincl.1l'`"
- then
- echo shar: "error transmitting 'ccincl.1l'" '(should have been 1583 characters)'
- fi
- fi
- echo shar: "extracting 'ccs.1l'" '(479 characters)'
- if test -f 'ccs.1l'
- then
- echo shar: "will not over-write existing file 'ccs.1l'"
- else
- sed 's/^X//' << \SHAR_EOF > 'ccs.1l'
- X.TH CS 1-ucb
- X.SH NAME
- Xcs \- print cake usage statistics
- X.SH ORIGIN
- XUniversity of Melbourne
- X.SH SYNOPSIS
- X.B cs
- X.SH DESCRIPTION
- X.sp 1
- X\fICs\fP prints out statistics on cake usage.
- XFor each cake user, it prints an invocation count,
- Xaverage time spent in the cake and child processes
- Xin user and system mode,
- Xaverage time spent in all processes and modes,
- Xtotal cpu time,
- Xand the ratio of cake user time to cake system time
- Xplus children's user and system times.
- X.\" @(#)cs.l 9/2/85
- SHAR_EOF
- if test 479 -ne "`wc -c < 'ccs.1l'`"
- then
- echo shar: "error transmitting 'ccs.1l'" '(should have been 479 characters)'
- fi
- fi
- echo shar: "extracting 'cs.1l'" '(479 characters)'
- if test -f 'cs.1l'
- then
- echo shar: "will not over-write existing file 'cs.1l'"
- else
- sed 's/^X//' << \SHAR_EOF > 'cs.1l'
- X.TH CS 1-ucb
- X.SH NAME
- Xcs \- print cake usage statistics
- X.SH ORIGIN
- XUniversity of Melbourne
- X.SH SYNOPSIS
- X.B cs
- X.SH DESCRIPTION
- X.sp 1
- X\fICs\fP prints out statistics on cake usage.
- XFor each cake user, it prints an invocation count,
- Xaverage time spent in the cake and child processes
- Xin user and system mode,
- Xaverage time spent in all processes and modes,
- Xtotal cpu time,
- Xand the ratio of cake user time to cake system time
- Xplus children's user and system times.
- X.\" @(#)cs.l 9/2/85
- SHAR_EOF
- if test 479 -ne "`wc -c < 'cs.1l'`"
- then
- echo shar: "error transmitting 'cs.1l'" '(should have been 479 characters)'
- fi
- fi
- echo shar: "extracting 'gred.1l'" '(275 characters)'
- if test -f 'gred.1l'
- then
- echo shar: "will not over-write existing file 'gred.1l'"
- else
- sed 's/^X//' << \SHAR_EOF > 'gred.1l'
- X.TH GRED 1-ucb
- X.SH NAME
- Xgred \- global regular expression delete
- X.SH ORIGIN
- XUniversity of Melbourne
- X.SH SYNOPSIS
- X.B gred
- Xpattern file ...
- X.SH DESCRIPTION
- X.sp 1
- X\fIGred\fP deleted from all its argument files
- Xthose lines matching the given ex(1) pattern.
- X.\" @(#)gred.l 9/2/85
- SHAR_EOF
- if test 275 -ne "`wc -c < 'gred.1l'`"
- then
- echo shar: "error transmitting 'gred.1l'" '(should have been 275 characters)'
- fi
- fi
- echo shar: "extracting 'gres.1l'" '(286 characters)'
- if test -f 'gres.1l'
- then
- echo shar: "will not over-write existing file 'gres.1l'"
- else
- sed 's/^X//' << \SHAR_EOF > 'gres.1l'
- X.TH GRES 1-ucb
- X.SH NAME
- Xgres \- global regular expression substitution
- X.SH ORIGIN
- XUniversity of Melbourne
- X.SH SYNOPSIS
- X.B gres
- Xoldpattern newpattern file ...
- X.SH DESCRIPTION
- X.sp 1
- X\fIGres\fP substitutes in all its argument files
- Xthe new ex(1) pattern for the old.
- X.\" @(#)gres.l 9/2/85
- SHAR_EOF
- if test 286 -ne "`wc -c < 'gres.1l'`"
- then
- echo shar: "error transmitting 'gres.1l'" '(should have been 286 characters)'
- fi
- fi
- echo shar: "extracting 'gsrc.1l'" '(1571 characters)'
- if test -f 'gsrc.1l'
- then
- echo shar: "will not over-write existing file 'gsrc.1l'"
- else
- sed 's/^X//' << \SHAR_EOF > 'gsrc.1l'
- X.ds g \fIgsrc\fP
- X.ds G \fIGsrc\fP
- X.TH GSRC 1-ucb
- X.SH NAME
- Xgsrc \- find generated files
- X.SH ORIGIN
- XUniversity of Melbourne
- X.SH SYNOPSIS
- X.B gsrc
- Xsuffix ... file ...
- X.SH DESCRIPTION
- X.sp 1
- X\*G is a tool for finding generated files.
- XIt is intended to be used in conjunction with cake(1),
- Xand in particular with the cakefiles Main and System.
- XIt needs to kinds of arguments.
- XOne is a make(1)-style list of suffixes
- Xwhich describe dependencies between files;
- Xthe other is a list of basic filenames
- X(filenames without any suffixes).
- XFor each base name argument,
- X\*g outputs the names of the files
- Xwhich have that base name,
- Xwhose suffix is on the suffixlist,
- Xand whose suffix is not the rightmost suffix for which a file exists.
- X.lp
- XSince this "explanation" is none too clear, here is an example:
- X.SH "EXAMPLE"
- X.sp 1
- XA typical invocation of \*g would be "gsrc .c .l .y file1 file2 file3"
- Xin a directory containing file1.c file2.c file2.y file3.c and file3.l;
- Xfor this \*g will output file2.c file3.c, signifying that
- Xfile2.c and file3.c were generated (by yacc(1) and lex(1) respectively).
- X.SH "SEE ALSO"
- Xcake(1), usrc(1)
- X.SH BUGS
- X.sp 1
- XSuffix dependencies really form a tree, not a list.
- XThis causes \*g to get confused if two user-written files
- X(i.e. non-generated files) have the same basename
- Xand if they both have their suffix on the list.
- XSince the Main and System cakefiles run \*g
- Xto identify files which are to be cleaned up,
- Xthis is definitely not healthy.
- XFor this reason, the default RM_CMD in those cakefiles
- Xjust moves its arguments to /tmp.
- X.\" @(#)gsrc.l 7/7/86
- SHAR_EOF
- if test 1571 -ne "`wc -c < 'gsrc.1l'`"
- then
- echo shar: "error transmitting 'gsrc.1l'" '(should have been 1571 characters)'
- fi
- fi
- echo shar: "extracting 'irrel.1l'" '(335 characters)'
- if test -f 'irrel.1l'
- then
- echo shar: "will not over-write existing file 'irrel.1l'"
- else
- sed 's/^X//' << \SHAR_EOF > 'irrel.1l'
- X.TH IRREL 1-ucb
- X.SH NAME
- Xirrel \- filter out irrelevant junk
- X.SH ORIGIN
- XUniversity of Melbourne
- X.SH SYNOPSIS
- X.B irrel
- Xpattern ...
- X.SH DESCRIPTION
- X.sp 1
- X\fIIrrel\fP is a filter which removes from the stream
- Xall lines matching any one of its argument patterns.
- XOther lines are passed through without modification.
- X.\" @(#)irrel.l 9/2/85
- SHAR_EOF
- if test 335 -ne "`wc -c < 'irrel.1l'`"
- then
- echo shar: "error transmitting 'irrel.1l'" '(should have been 335 characters)'
- fi
- fi
- echo shar: "extracting 'later.1l'" '(672 characters)'
- if test -f 'later.1l'
- then
- echo shar: "will not over-write existing file 'later.1l'"
- else
- sed 's/^X//' << \SHAR_EOF > 'later.1l'
- X.TH LATER 1-ucb
- X.SH NAME
- Xlater \- print files later than a reference file
- X.SH ORIGIN
- XUniversity of Melbourne
- X.SH SYNOPSIS
- X.B later
- X[\-cs] reffile file ...
- X.SH DESCRIPTION
- X.sp 1
- X\fILater\fP is a tool intended to work with \fIcake\fP.
- XOf its second and later arguments,
- Xit prints out those which have a strictly later modify time
- Xthan the reference file.
- XIf \-c (count) is given, it also returns
- Xthe number of filenames printed as its exit status.
- XThis program is intended to do for \fIcake\fP
- Xwhat the $? macro does for \fImake\fP.
- XIf -s (silent) is given,
- Xit does not print anything;
- Xit only returns the exit status.
- X.SH "SEE ALSO"
- Xmake(1), cake(1)
- X.\" @(#)later.l 9/2/85
- SHAR_EOF
- if test 672 -ne "`wc -c < 'later.1l'`"
- then
- echo shar: "error transmitting 'later.1l'" '(should have been 672 characters)'
- fi
- fi
- echo shar: "extracting 'need.1l'" '(569 characters)'
- if test -f 'need.1l'
- then
- echo shar: "will not over-write existing file 'need.1l'"
- else
- sed 's/^X//' << \SHAR_EOF > 'need.1l'
- X.TH NEED 1-ucb
- X.SH NAME
- Xneed \- find appropriate preprocessors
- X.SH ORIGIN
- XUniversity of Melbourne
- X.SH SYNOPSIS
- X.B need
- Xprogram file
- X.SH DESCRIPTION
- X.sp 1
- X\fINeed\fP is a tool intended to work with \fIcake\fP.
- XIt returns a zero exit status
- Xif \fIfile\fP needs to be processed with \fIprogram\fP
- Xand nonzero otherwise.
- X\fINeed\fP searches \fIfile\fP for a line which contains
- Xboth the keyword NEED and the name of the \fIprogram\fP.
- XBy convention files should begin with a comment line
- Xindicating all necessary preprocessors.
- X.SH "SEE ALSO"
- Xcake(1)
- X.\" @(#)need.l 9/2/85
- SHAR_EOF
- if test 569 -ne "`wc -c < 'need.1l'`"
- then
- echo shar: "error transmitting 'need.1l'" '(should have been 569 characters)'
- fi
- fi
- echo shar: "extracting 'needed.1l'" '(653 characters)'
- if test -f 'needed.1l'
- then
- echo shar: "will not over-write existing file 'needed.1l'"
- else
- sed 's/^X//' << \SHAR_EOF > 'needed.1l'
- X.TH NEED 1-ucb
- X.SH NAME
- Xneeded \- find appropriate preprocessors
- X.SH ORIGIN
- XUniversity of Melbourne
- X.SH SYNOPSIS
- X.B needed
- Xfile
- X.SH DESCRIPTION
- X.sp 1
- X\fINeeded\fP is a tool intended to work with \fIcake\fP
- Xand the cakefile Text.
- XIt returns the characters in \fIfile\fP
- Xbetween the first occurrence of the word NEED
- Xand the next end-of-line.
- XBy convention this contains the generic names
- Xof the list of nroff/troff preprocessors
- X\fIfile\fP needs to be put through.
- X("Generic" means that you should use "eqn" instead of "neqn" or "deqn";
- XText will choose the appropriate version based on the intended target.)
- X.SH "SEE ALSO"
- Xcake(1)
- X.\" @(#)need.l 9/2/85
- SHAR_EOF
- if test 653 -ne "`wc -c < 'needed.1l'`"
- then
- echo shar: "error transmitting 'needed.1l'" '(should have been 653 characters)'
- fi
- fi
- echo shar: "extracting 'ol.1l'" '(594 characters)'
- if test -f 'ol.1l'
- then
- echo shar: "will not over-write existing file 'ol.1l'"
- else
- sed 's/^X//' << \SHAR_EOF > 'ol.1l'
- X.TH OL 1-ucb
- X.SH NAME
- Xol \- print an outline of papers written with -me
- X.SH ORIGIN
- XUniversity of Melbourne
- X.SH SYNOPSIS
- X.B ol
- Xfile ...
- X.SH DESCRIPTION
- X.sp 1
- X\fIOl\fP prints out paper outlines.
- XIt recognizes the -me section macros .sh and .uh,
- Xas well as the local macros .tr, .le, .co and .dt
- Xfor theorems, lemmas, corollaries and definition of terms.
- XFor each of these macros, ol prints out its source line number,
- Xwhat it introduces (e.g. sction 1.2.3 or theorem 4.5), and
- Xits title (e.g. "Introduction" or "Pumping lemma").
- XThe latter two are indented to show structure.
- X.\" @(#)ol.l 9/2/85
- SHAR_EOF
- if test 594 -ne "`wc -c < 'ol.1l'`"
- then
- echo shar: "error transmitting 'ol.1l'" '(should have been 594 characters)'
- fi
- fi
- echo shar: "extracting 'soincl.1l'" '(397 characters)'
- if test -f 'soincl.1l'
- then
- echo shar: "will not over-write existing file 'soincl.1l'"
- else
- sed 's/^X//' << \SHAR_EOF > 'soincl.1l'
- X.TH SOINCL 1-ucb
- X.SH NAME
- Xsoincl \- find included nroff files
- X.SH ORIGIN
- XUniversity of Melbourne
- X.SH SYNOPSIS
- X.B soincl
- Xfile ...
- X.SH DESCRIPTION
- X.sp 1
- X\fISoincl\fP is a tool to find files included by nroff's .so commands.
- XIt is intended to be used in conjunction with cake(1).
- XIt goes through the given files and prints out all .so'd files.
- X.SH "SEE ALSO"
- Xcake(1)
- X.SH BUGS
- X.\" @(#)soincl.l 9/2/85
- SHAR_EOF
- if test 397 -ne "`wc -c < 'soincl.1l'`"
- then
- echo shar: "error transmitting 'soincl.1l'" '(should have been 397 characters)'
- fi
- fi
- echo shar: "extracting 'ssize.1l'" '(276 characters)'
- if test -f 'ssize.1l'
- then
- echo shar: "will not over-write existing file 'ssize.1l'"
- else
- sed 's/^X//' << \SHAR_EOF > 'ssize.1l'
- X.TH SSIZE 1-ucb
- X.SH NAME
- Xssize \- sort wc -v output by file size
- X.SH ORIGIN
- XUniversity of Melbourne
- X.SH SYNOPSIS
- X.B size
- Xfile ...
- X.SH DESCRIPTION
- X.sp 1
- X\fISsize\fP runs wc -v on its arguments
- Xand sorts the resulting output by size.
- X.SH "SEE ALSO"
- Xwc(1)
- X.\" @(#)ssize.l 9/2/85
- SHAR_EOF
- if test 276 -ne "`wc -c < 'ssize.1l'`"
- then
- echo shar: "error transmitting 'ssize.1l'" '(should have been 276 characters)'
- fi
- fi
- echo shar: "extracting 'sub.1l'" '(1098 characters)'
- if test -f 'sub.1l'
- then
- echo shar: "will not over-write existing file 'sub.1l'"
- else
- sed 's/^X//' << \SHAR_EOF > 'sub.1l'
- X.TH SUB 1-ucb
- X.SH NAME
- Xsub \- perform substitutions
- X.SH ORIGIN
- XUniversity of Melbourne
- X.SH SYNOPSIS
- X.B sub
- X[-i] [-vchar] oldpattern newpattern name ...
- X.SH DESCRIPTION
- X.sp 1
- X\fISub\fP is a tool intended to work with \fIcake\fP,
- Xalthough it may be useful in its own right.
- XThe first two nonoption arguments are name patterns in the sense of
- Xcake(l), except that variables are introduced not by % but by X,
- Xor by the character following \-v if it is given.
- X.sp 1
- XSub matches each name against the old pattern,
- Xsetting up the values of its variables,
- Xthen prints out the new pattern with those values substituted.
- XIf a name does not match the old pattern, \fIsub\fP prints nothing.
- XE.g. the command "sub X.c X.o x.c y.h z.c" prints "x.o z.o".
- X.sp 1
- XThe exit code of \fIsub\fP is the number of unmatched names;
- Xthe example above would exit with status code 1.
- XThis can be useful for testing
- Xwhether a name comforms to a pattern or not.
- XHowever, the \-i option makes \fIsub\fP ignore failed matches;
- Xwhen given \fIsub\fP will always exit with a zero status.
- X.SH "SEE ALSO"
- Xcake(1)
- X.\" @(#)sub.l 6/10/85
- SHAR_EOF
- if test 1098 -ne "`wc -c < 'sub.1l'`"
- then
- echo shar: "error transmitting 'sub.1l'" '(should have been 1098 characters)'
- fi
- fi
- echo shar: "extracting 'subcmd.1l'" '(1400 characters)'
- if test -f 'subcmd.1l'
- then
- echo shar: "will not over-write existing file 'subcmd.1l'"
- else
- sed 's/^X//' << \SHAR_EOF > 'subcmd.1l'
- X.TH SUBCMD 1-ucb
- X.SH NAME
- Xsubcmd \- execute commands with arguments based on substitutions
- X.SH ORIGIN
- XUniversity of Melbourne
- X.SH SYNOPSIS
- X.B subcmd
- X[-fginz] [-vchar] cmd oldpattern newpattern file ...
- X.SH DESCRIPTION
- X.sp 1
- X\fISubcmd\fP is a version of sub(1) which,
- Xinstead of printing out the result of its substitutions,
- Xuses them to invoke a command.
- XIf the \-g option is not present, the command is formed
- Xby concatenating cmd, oldpattern(file) and newpattern(file)
- X(with spaces in between, of course).
- XIf it is, cmd is treated as a sprintf(3) control string
- Xand given oldpattern(file) and newpattern(file) as arguments.
- XFor example "subcmd mv X X.old x y z"
- Xinvokes mv x x.old, mv y y.old, and mv z z.old,
- Xwhile "subcmd -g 'grep xyzzy < %s > %s' X X.out x y z"
- Xinvokes grep xyzzy < x > x.out, grep xyzzy < y > y.out,
- Xand grep xyzzy < z > z.out.
- X.SH OPTIONS
- XThe -f (fast) option causes subcmd to use only one shell,
- Xinstead of one per executed command.
- XThe \-i and \-v options of \fIsubcmd\fP are the same as that of sub(1).
- XThe \-g option affects the format of the command as specified above.
- X\-n causes commands to be printed but not executed.
- X\-z turns off checking for zero status (see diagnostics).
- X.SH DIAGNOSTICS
- XOne message per command executed;
- Xerror message if command fails (returns nonzero status);
- Xsame return code as sub(1).
- X.SH "SEE ALSO"
- Xsub(1), cake(1)
- X.\" @(#)subcmd.l 6/10/85
- SHAR_EOF
- if test 1400 -ne "`wc -c < 'subcmd.1l'`"
- then
- echo shar: "error transmitting 'subcmd.1l'" '(should have been 1400 characters)'
- fi
- fi
- echo shar: "extracting 'usrc.1l'" '(1522 characters)'
- if test -f 'usrc.1l'
- then
- echo shar: "will not over-write existing file 'usrc.1l'"
- else
- sed 's/^X//' << \SHAR_EOF > 'usrc.1l'
- X.ds u \fIusrc\fP
- X.ds U \fIUsrc\fP
- X.TH USRC 1-ucb
- X.SH NAME
- Xusrc \- find ultimate source files
- X.SH ORIGIN
- XUniversity of Melbourne
- X.SH SYNOPSIS
- X.B usrc
- Xsuffix ... file ...
- X.SH DESCRIPTION
- X.sp 1
- X\*U is a tool for finding ultimate source files.
- XIt is intended to be used in conjunction with cake(1),
- Xand in particular with the cakefiles Main and System.
- XIt needs to kinds of arguments.
- XOne is a make(1)-style list of suffixes
- Xwhich describe dependencies between files;
- Xthe other is a list of basic filenames
- X(filenames without any suffixes).
- X\*U outputs each base name argument
- Xtogether with the rightmost suffix on the list
- Xfor which a file exists.
- XSince this "explanation" is none too clear, here is an example:
- X.SH "EXAMPLE"
- X.sp 1
- XA typical invocation of \*u would be "usrc .c .l .y file1 file2 file3"
- Xin a directory containing file1.c file2.c file2.y file3.c and file3.l;
- Xfor this \*u will output file1.c file2.y file3.l, signifying that
- Xthe ultimate source files are file1.c file2.y file3.l and that the
- Xothers (file2.c and file3.c) were generated
- X(by yacc(1) and lex(1) respectively).
- X.SH "SEE ALSO"
- Xcake(1), gsrc(1)
- X.SH BUGS
- X.sp 1
- XSuffix dependencies really form a tree, not a list.
- XThis causes \*u to get confused if two ultimate source files
- X(i.e. non-generated files) have the same basename
- Xand if they both have their suffix on the list.
- XSince the Main and System cakefiles run \*u
- Xto identify files which are to be printed,
- Xthis is not too serious (unlike tha parallel problem with gsrc(1)).
- X.\" @(#)usrc.l 7/7/86
- SHAR_EOF
- if test 1522 -ne "`wc -c < 'usrc.1l'`"
- then
- echo shar: "error transmitting 'usrc.1l'" '(should have been 1522 characters)'
- fi
- fi
- echo shar: "extracting 'yyrepl.1l'" '(1210 characters)'
- if test -f 'yyrepl.1l'
- then
- echo shar: "will not over-write existing file 'yyrepl.1l'"
- else
- sed 's/^X//' << \SHAR_EOF > 'yyrepl.1l'
- X.TH YYREPL 1-ucb
- X.SH NAME
- Xyyrepl \- manage two or more yacc/lex systems in the same directory
- X.SH ORIGIN
- XUniversity of Melbourne
- X.SH SYNOPSIS
- X.B yyrepl
- Xpatternfile targetfile ...
- X.SH DESCRIPTION
- X.sp 1
- XThe standard Unix tools yacc(1) and lex(1)
- Xare not set up to work with multiple parsers and/or scanners
- Xin the same directory.
- XThey put their output in fixed-name files
- Xand export and import fixed-name data structures and functions.
- X.sp 1
- X\fIYyrepl\fP is a tool intended to work with \fIcake\fP,
- Xalthough it can also be used with \fImake\fP and on its own.
- XIt searches \fIpatternfile\fP for a line which contains
- Xthe keyword YYREPL followed by (at least) two words.
- XThen it goes through the \fItargetfile\fPs,
- Xsystematically substituting
- Xthe first word for yy and the second word for YY.
- X.sp 1
- XIn the intended usage,
- Xevery yacc (or lex) file except possibly one has a YYREPL line,
- Xwith these lines specifying different replacements
- X(e.g. xx XX and zz ZZ).
- XThen \fIyyrepl\fP is run once for each parser/scanner pair,
- Xwith the \fIpatternfile\fP is being the yacc (or lex) source
- Xand the \fItargetfile\fPs are the parser and scanner in C.
- X.SH "SEE ALSO"
- Xyacc(1), lex(1), make(1), cake(1)
- X.\" @(#)yyrepl.l 9/2/85
- SHAR_EOF
- if test 1210 -ne "`wc -c < 'yyrepl.1l'`"
- then
- echo shar: "error transmitting 'yyrepl.1l'" '(should have been 1210 characters)'
- fi
- fi
- exit 0
- # End of shell archive
-